<template>
  <div id="baseLayout">
    <a-layout class="layout">
      <a-layout-header class="header">
        <a-row type="flex">
          <a-col flex="180px" class="margin">
            <router-link to="/home">
              <div class="logo">
                <img src="../assets/img/logo.jpg" alt="Brother - 表情包专业户"/>
                  <span class="title">Brother</span>
              </div>
            </router-link>
          </a-col>
          <a-col flex="auto">
            <a-menu
                theme="dark"
                mode="horizontal"
                :selectedKeys="['/home']"
                :style="{ lineHeight: '64px' }"
            >
              <a-menu-item key="/home">
                <router-link to="/home">首页</router-link>
              </a-menu-item>
              <a-menu-item key="/admin">
                <router-link to="/admin">管理</router-link>
              </a-menu-item>
            </a-menu>
          </a-col>
          <a-col>
            <a-button type="primary" @click="doShowCreateEmoji">
              <template>
               <a-icon type="smile" theme="outlined" spin />
              </template>
              上传表情
            </a-button>
          </a-col>
        </a-row>
      </a-layout-header>
      <a-layout-content style="padding: 16px 50px">
        <Emoji></Emoji>
      </a-layout-content>
      <a-layout-footer style="text-align: center">
        Brother ©2022 Created by gali
      </a-layout-footer>
    </a-layout>
    <CreateEmoji :visible.sync="showCreateModal" :onClose="doCloseCreateModal"/>
  </div>

</template>

<script>
import CreateEmoji from "@/components/CreateEmoji";
import Emoji from "@/components/Emoji";
export default {
name: "Home",
  components:{
    CreateEmoji,Emoji
  },
  data(){
  return{
    showCreateModal:false
  }
  },
  methods:{
    doShowCreateEmoji(){
      this.showCreateModal = true;
    },
    doCloseCreateModal() {
      this.showCreateModal = false;
    }
  }
}
</script>

<style scoped>
.logo {
  display: flex;
  align-items: center;
  height: 64px;
}

.logo > img {
  margin-right: 16px;
  height: 80%;
}

.title {
  font-size: 18px;
  color: #fff;
  margin-right: 16px;
  letter-spacing: 4px;
}
</style>
